namespace _1._12._2015_TodoWebAPI.Data.Migrations
{
    using System;
    using System.Data.Entity.Migrations;
    
    public partial class auditObject : DbMigration
    {
        public override void Up()
        {
            AddColumn("dbo.Todoes", "DateUpdated", c => c.DateTime(nullable: false));
            AddColumn("dbo.Todoes", "CreatedUserId", c => c.String(nullable: false, maxLength: 128));
            AddColumn("dbo.Todoes", "UpdatedUserId", c => c.String(nullable: false, maxLength: 128));
            AddColumn("dbo.Todoes", "IsDeleted", c => c.Boolean(nullable: false));
            CreateIndex("dbo.Todoes", "CreatedUserId");
            CreateIndex("dbo.Todoes", "UpdatedUserId");
            AddForeignKey("dbo.Todoes", "CreatedUserId", "dbo.AspNetUsers", "Id", cascadeDelete: false);
            AddForeignKey("dbo.Todoes", "UpdatedUserId", "dbo.AspNetUsers", "Id", cascadeDelete: false);
        }
        
        public override void Down()
        {
            DropForeignKey("dbo.Todoes", "UpdatedUserId", "dbo.AspNetUsers");
            DropForeignKey("dbo.Todoes", "CreatedUserId", "dbo.AspNetUsers");
            DropIndex("dbo.Todoes", new[] { "UpdatedUserId" });
            DropIndex("dbo.Todoes", new[] { "CreatedUserId" });
            DropColumn("dbo.Todoes", "IsDeleted");
            DropColumn("dbo.Todoes", "UpdatedUserId");
            DropColumn("dbo.Todoes", "CreatedUserId");
            DropColumn("dbo.Todoes", "DateUpdated");
        }
    }
}
